home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / winlib3.zip / WSTRUCT.H < prev    next >
Text File  |  1991-01-14  |  5KB  |  126 lines

  1. /* Note:  scroll bars on viewports will be supported in a future version */
  2.  
  3. #ifndef _WINSTRUCT_DEF
  4.  
  5. #define _WINSTRUCT_DEF
  6.  
  7. #define MAXVBUFSIZE  0xFFFFUL
  8.  
  9. #if defined (LPOWERC)
  10.   typedef  char far *  WBUFPTR;
  11. #else
  12.   typedef  char *      WBUFPTR;
  13. #endif
  14.  
  15. #ifndef NUMBOXCHARS
  16. #define NUMBOXCHARS  8
  17. #endif
  18. #ifndef MAXSCROLLSTRING
  19. #define MAXSCROLLSTRING 6
  20. #endif
  21.  
  22.  typedef struct v_win_status
  23.  {
  24.    unsigned viewport_flag:1;     /* tells if virtual window has a viewport */
  25.    unsigned vwtype:1;            /* tells what type of virtual window */
  26.    unsigned wrap_flag:1;
  27.    unsigned big_vw:1;
  28.  }  V_WIN_STAT;
  29.  
  30.  
  31.  typedef struct virtual_window
  32.  {
  33.      unsigned nbufs;                         /* number of 64K buffers required */
  34.    unsigned char far * far *text;          /* pointer to huge text */
  35.    unsigned char far * far *attr;          /* pointer to attributes */
  36.    unsigned  nrows;                        /* number of rows in window */
  37.    unsigned  ncols;                        /* number of columns in window */
  38.    unsigned row;                           /* row of logical cursor */
  39.    unsigned col;                           /* col of logical cursor */
  40.    int wnum;                               /* virtual window number */
  41.    int num_windows;                     /* pointer to list of windows */
  42.    V_WIN_STAT stat_info;
  43.  }  VWINDOW, *VWPOINTER;
  44.  
  45.  
  46.  
  47.  
  48.  /****************************
  49.  * Define window status bits *
  50.  ****************************/
  51.  
  52. typedef struct win_status
  53. {
  54.   unsigned border_flag:1;       /* Window border flag */
  55.   unsigned wrap_flag:1;         /* Window wrap flag */
  56.   unsigned open_flag:1;         /* window open flag */
  57.   unsigned init_flag:1;         /* window initialized flag */
  58.   unsigned visible_flag:1;      /* window visible flag */
  59.   unsigned v_window_flag:1;     /* window is a viewport flag */
  60.   unsigned bufptr_flag:1;       /* tells if memory allocated for window buffer
  61.                                  * pointer   */
  62.   unsigned sync_curs:1;         /* tells if cursor is to be moved */
  63.   unsigned frozen_flag:1;       /* tells if virtual window is frozen */
  64.   unsigned seethru_flag:1;      /* tells if window is a see thru window */
  65.   unsigned move_flag:1;         /* used internally for window update routines */
  66.   /*unsigned scroll_bars_on:1;  */  /* tells if scroll bars are on */
  67. } WIN_STAT;
  68.  
  69. typedef struct
  70. {
  71.   unsigned shadow_flag:1;       /* tells if there is a shadow */
  72.   unsigned shadow_pos:3;        /* tells where shadow is */
  73.   unsigned shadow_trans:1;      /* tells if shadow is transparent */
  74. } SHADOW_STAT;
  75.  
  76.  
  77. typedef struct
  78. {
  79.    int schar;                     /* shadow character */
  80.    int sattr;                     /* shadow attribute */
  81.    int swidth;
  82.    int sheight;
  83.    SHADOW_STAT shadow_stat;
  84. } WIN_SHADOW;
  85.  
  86.  
  87. typedef struct
  88. {
  89.   char scroll_string[MAXSCROLLSTRING];
  90.   int hilite_attr;
  91.   int norm_attr;
  92. } SCROLL_BAR_INFO;
  93.  
  94.  /**************************
  95.  * Define window structure *
  96.  **************************/
  97.  
  98.  typedef struct window
  99.  {
  100.    VWPOINTER vwptr;                 /* pointer to virtual window */
  101.    unsigned int vwrow;              /* virtual window row */
  102.    unsigned int vwcol;              /* virtual window column */
  103.    int origx;                       /* original x-position */
  104.    int origy;                       /* original y-position */
  105.    int col;                         /* window column */
  106.    int row;                         /* window row  */
  107.    int width;                       /* window width */
  108.    int height;                      /* window height */
  109.    int xpos;                        /* current window x position */
  110.    int ypos;                        /* current window y position */
  111.    int wnum;                        /* Window number */
  112.    int rank;                        /* Where window is in list of windows */
  113.    int pagenum;                     /* video page where window is opened */
  114.    int cursorshape;                 /* tells the cursor shape */
  115.    int battr;                       /* border attribute */
  116.    int wattr;                       /* window attribute */
  117.    char boxchars[NUMBOXCHARS];      /* box characters */
  118.    WBUFPTR textbuf;                 /* points to text plane */
  119.    WIN_STAT stat_info;              /* window status flags */
  120.    WIN_SHADOW shadow_info;          /* shadow status */
  121. /*   SCROLL_BAR_INFO scroll_bar_info;  scroll bar information */
  122.  } WINDOW, *WPOINTER;
  123.  
  124. #include  <vidsys.h>
  125. #endif
  126.